package com.apobates.jforum2.troll.forum.biz.impl.api;

import com.apobates.jforum2.troll.forum.ForumFeignClientConfig;
import com.apobates.jforum2.troll.regular.ForumActionEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 版块内部服务客户端
 * @author xiaofanku
 * @since 20210413
 */
@Component
@FeignClient(value="TROLL-GATEWAY", configuration = ForumFeignClientConfig.class)
@RequestMapping("/")
public interface BoardFeignServiceApi {
    @GetMapping("/logs/board/favorited")
    boolean isFavoritedBoard(@RequestParam("board")long boardId, @RequestParam("member")long memberId);
    
    @GetMapping("/logs/board/action/member")
    long getActionBoard(@RequestParam("board")long boardId, @RequestParam("member")long memberId, @RequestParam("action")ForumActionEnum action);
    //从版块收藏/取消收藏中脱离出来
    //为下次取消收藏/收藏清路
    @PostMapping(value="/logs/board/action/delete", consumes="application/x-www-form-urlencoded")
    boolean removeActionBoard(@RequestParam("board")long boardId, @RequestParam("member")long memberId, @RequestParam("action")ForumActionEnum action);
}